<!--
 * @Descripttion: 
 * @version: 
 * @Author: QYFeng
 * @Date: 2021-05-16 17:42:11
 * @LastEditors: QYFeng
 * @LastEditTime: 2021-05-16 17:42:28
-->
<template>
  <div class="main">
    <!-- 顶部轮播 -->
    <swiper :options="swiperOption">
      <swiper-slide v-for="(item, index) in bannerData" :key="index">
        <a target="_blank" :href="item.url">
          <img :src="item.image" alt="" srcset="" />
        </a>
      </swiper-slide>
    </swiper>
    <div class="center">
      <div class="head">联系我们</div>
      <div class="body" v-html="configData.contact"></div>
      <div class="foot">
        <div class="lf">
          <p>
            <el-image lazy :src="require('../assets/images/tel-icon.png')" alt="" srcset="" />
            <span>{{configData.phone}}</span>
          </p>
          <p>
            <el-image lazy :src="require('../assets/images/qq-icon.png')" alt="" srcset="" />
            <span>{{configData.qq}}</span>
          </p>
        </div>
        <div class="rt">
          <p>
            <el-image lazy :src="require('../assets/images/email-icon.png')" alt="" srcset="" />
            <span>{{configData.email}}</span>
          </p>
          <p>
            <el-image lazy :src="require('../assets/images/address-icon.png')" alt="" srcset="" />
            <span>{{configData.address}}</span>
          </p>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      // 顶部轮播图设置
      swiperOption: {
        autoplay: {
          disableOnInteraction: false, // 用户操作swiper之后，是否禁止autoplay
          delay: 5000, // 自动切换的时间间隔（单位ms）
        },
        // loop: true,
      },
      bannerData:[],
      configData:[]
    };
  },
  created () {
    // 顶部轮播
    this.$http.getBanner().then((res) => {
      if (res.data.code === 0) {
        this.bannerData = res.data.data;
      } else {
        this.$message.error("获取失败，请重试！");
      }
    });
    this.$http.getConfig().then((res) => {
      if (res.data.code === 0) {
        this.configData = res.data.data;
      } else {
        this.$message.error("获取失败，请重试！");
      }
    });
  }
};
</script>

<style lang="scss" scoped>
.center {
  width: 1200px;
  margin: 0 auto;
  padding: 80px 0;
  .head {
    font-size: 20px;
    font-family: PingFang SC;
    font-weight: bold;
    line-height: 50px;
    color: #333333;
  }
  .body {
    margin-top: 40x;
    font-size: 16px;
    font-family: PingFang SC;
    font-weight: 400;
    line-height: 28px;
    color: #333333;
  }
  .foot {
    display: flex;
    justify-content: space-between;
    padding-top: 80px;
    p {
      height: 33px;
      display: flex;
      align-items: center;
      .el-image {
        width: 26px;
        height: 26px;
        margin-right: 10px;
        span {
          font-size: 16px;
          font-family: PingFang SC;
          font-weight: 400;
          line-height: 40px;
          color: #333333;
        }
      }
    }
    p:nth-child(1),
    p:nth-child(2) {
      margin-bottom: 30px;
    }
  }
}
::v-deep {
  .swiper-container {
    height: 400px;
    width: 100%;
    img {
      width: 100%;
      height: 100%;
    }
  }
}
</style>